package com.example.demo;

import cn.hutool.core.net.NetUtil;
import cn.hutool.extra.servlet.ServletUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * @author Administrator
 * @version 1.0
 * @description //TODO
 * @date 2024/1/15 13:47
 **/
@RestController
@RequestMapping("/login")
public class LoginController {
    @GetMapping
    public String login(HttpServletRequest request, String username, String password) {

        System.out.println("username: " + username + " , password: " + password + "; At: " + LocalDateTime.now());
        return "login request success; ip: " + ServletUtil.getClientIP(request);
    }
}
